<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>个人中心</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #fff;
            line-height: 1;
            overflow: hidden;
        }
        /*日历框*/

        .rl_box {
            height: 13.5rem;
            width: calc(100vw - 25px);
            position: fixed;
            bottom: 1rem;
            left: 12.5px;
            background: #ffc75e;
            border-radius: 0.5rem;
            /*z-index: -1;*/
        }

        .today {
            text-align: center;
            padding: 0.5rem;
            color: #FFF;
            font-weight: 600;
        }
        /*记录*/

        .jl_box {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem 0;
        }

        .jl_box .line {
            width: 1px;
            height: 0.5rem;
            background: #ffc75e;
            margin: 0rem 1rem;
        }

        .have_day,
        .get_jf {
            font-size: 0.75rem;
            color: #ffc75e;
        }

        .have_day span,
        .get_jf span {
            font-size: 1rem;
            color: #f23030;
            padding: 0 0.2rem;
        }

        .img_box {
            position: relative;
            height: calc(100vh - 17.5rem);
            background: -webkit-linear-gradient(#fdbf48, #ffb228);
            background: -o-linear-gradient(#fdbf48, #ffb228);
            background: -moz-linear-gradient(#fdbf48, #ffb228);
            background: linear-gradient(to right, #fdbf48, #ffb228);
            border-radius: 0 0 50% 50%;
            width: 150%;
            left: 50%;
            transform: translateX(-50%);
        }

        .img_box img {
            width: 100%;
        }

        .gz_btn {
            position: absolute;
            right: 0;
            top: 1rem;
            padding: 0.3rem 0.2rem 0.3rem 0.7rem;
            border-radius: 1rem 0 0 1rem;
            background: #ff8f31;
            font-size: 0.7rem;
            color: #fff;
            z-index: 99;
        }

        .qd_btn {
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 50%;
            transform: translateX(-50%);
            padding: 0.5rem 0;
            background: #f23030;
            color: #FFF;
            font-size: 1rem;
            font-weight: 600;
            border-radius: 1rem;
            text-align: center;
        }

        img.txt_img {
            width: 40%;
            position: absolute;
            left: 50%;
            top: 2.5rem;
            transform: translateX(-50%);
            z-index: 2;
        }

        img.box_img {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }

        .gz_url_box {
            position: absolute;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999999;
            display: none;
        }

        .iframe_box {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90vw;
            height: 50vh;
            background: #fff;
            border-radius: 0.5rem;
            overflow: hidden;
        }

        .iframe_box .btn_title {
            position: relative;
            padding: 0.5rem 0;
            text-align: center;
            color: #fff;
            background: #ffc75e;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .iframe_box .btn_title .close_btn {
            position: absolute;
            right: 0.5rem;
            top: 50%;
            transform: translateY(-50%);
            color: #fff;
            font-size: 1rem;
        }

        .gz_url_box iframe {
            width: 100%;
            height: calc(100% - 0.9rem);
            border: none;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="gz_btn" onclick="look_gz()">签到规则</div>
        <div class="img_box">
            <img src="../../image/txt.png" alt="" class="txt_img">
            <img src="../../image/box.png" alt="" class="box_img">
            <div class="qd_btn" onclick="qiandao()">签到领取10积分</div>
        </div>

        <div class="jl_box">
            <div class="have_day">本月已签到<span>0</span>天</div>

            <div class="line"></div>

            <div class="get_jf">已领取<span>0</span>积分</div>
        </div>

        <div class="rl_box">
            <div class="today">2018.06</div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="data:application/octet-stream;base64,LyoqDQogKiBhdWktcHVsbC1yZWZyZXNoLmpzDQogKiBAYXV0aG9yIOa1gea1queUtw0KICogQHRvZG8gbW9yZSB0aGluZ3MgdG8gYWJzdHJhY3QsIGUuZy4gTG9hZGluZyBjc3MgZXRjLg0KICogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlLg0KICogaHR0cDovL3d3dy5vcGVuc291cmNlLm9yZy9saWNlbnNlcy9taXQtbGljZW5zZS5waHANCiAqLw0KKGZ1bmN0aW9uKHdpbmRvdykgew0KCSd1c2Ugc3RyaWN0JzsNCgkvKioNCgkgKiBFeHRlbmQgb2JqIGZ1bmN0aW9uDQoJICoNCgkgKiBUaGlzIGlzIGFuIG9iamVjdCBleHRlbmRlciBmdW5jdGlvbi4gSXQgYWxsb3dzIHVzIHRvIGV4dGVuZCBhbiBvYmplY3QNCgkgKiBieSBwYXNzaW5nIGluIGFkZGl0aW9uYWwgdmFyaWFibGVzIGFuZCBvdmVyd3JpdGluZyB0aGUgZGVmYXVsdHMuDQoJICovDQoJdmFyIGF1aVB1bGxUb1JlZnJlc2ggPSBmdW5jdGlvbiAocGFyYW1zLGNhbGxiYWNrKSB7DQoJCXRoaXMuZXh0ZW5kKHRoaXMucGFyYW1zLCBwYXJhbXMpOw0KCQl0aGlzLl9pbml0KGNhbGxiYWNrKTsNCgl9DQoJdmFyIHRvdWNoWURlbHRhOw0KCXZhciBpc0xvYWRpbmcgPSBmYWxzZTsNCgl2YXIgZG9jRWxlbSA9IHdpbmRvdy5kb2N1bWVudC5kb2N1bWVudEVsZW1lbnQsDQoJCWxvYWRXcmFwSCwNCgkJd2luID0ge3dpZHRoOiB3aW5kb3cuaW5uZXJXaWR0aCwgaGVpZ2h0OiB3aW5kb3cuaW5uZXJIZWlnaHR9LA0KCQl3aW5mYWN0b3I9IDAuMiwNCgkJ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l9Ow0KCQkJdGhyb3R0bGUocmVzaXplKCksIDEwKTsNCgkJfSwNCgkJZXh0ZW5kOiBmdW5jdGlvbihhLCBiKSB7DQoJCQlmb3IgKHZhciBrZXkgaW4gYikgew0KCQkJICAJaWYgKGIuaGFzT3duUHJvcGVydHkoa2V5KSkgew0KCQkJICAJCWFba2V5XSA9IGJba2V5XTsNCgkJCSAgCX0NCgkJICAJfQ0KCQkgIAlyZXR1cm4gYTsNCgkJIH0NCgl9DQoJd2luZG93LmF1aVB1bGxUb1JlZnJlc2ggPSBhdWlQdWxsVG9SZWZyZXNoOw0KDQp9KSh3aW5kb3cpOw0K"></script>
<script type="text/javascript">
    var UICalendar;
    var qiandaoriqi = [];
    apiready = function() {
        // alert(api.frameWidth)
        if (api.frameWidth <= 320) {
            $('.box_img').css({
                'width': '10%',
                'top': '5rem'
            })
        } else {
            $('.box_img').css({
                'width': '15%',
                'top': '6.5rem'
            })
        }

        // 获取签到数据
        api.showProgress({
            style: 'default',
            animationType: 'fade',
            title: '努力加载中...',
            text: '先喝杯茶...',
            modal: false
        });





        api.ajax({
            url: window.Url.Freeucenter_signData,
            method: 'post',
            data: {
                values: {
                    token: $api.getStorage('token')
                }
            }
        }, function(ret, err) {
            api.hideProgress();
            if (ret) {
                console.log("获取签到数据----" + JSON.stringify(ret));
                if (ret.re == 1) {
                    // alert(parseInt($('.get_jf span').text())+ret.data.list.length)

                    if (ret.data.list.length != 0) {

                      // $('.have_day span').text(ret.data.list.length);
                      // $('.get_jf span').text(ret.data.integral)

                      $('.have_day span').text(parseInt($('.have_day span').text())+1)
                      $('.get_jf span').text(parseInt($('.get_jf span').text())+parseInt(ret.data.integral)*ret.data.list.length);

                        for (var i = 0; i < ret.data.list.length; i++) {
                            qiandaoriqi.push({
                                date: ret.data.list[i].time
                            })
                        }
                        UICalendar.setSpecialDates({
                            specialDates: qiandaoriqi
                        });
                    }
                }
            } else {
                alert(JSON.stringify(err));
            }
        });





        UICalendar = api.require('UICalendar');
        UICalendar.open({
            rect: {
                x: 30,
                y: api.frameHeight - 250,
                w: api.frameWidth - 60,
                h: 220
            },
            styles: {
                bg: '#fff3dd',
                week: {
                    weekdayColor: '#3b3b3b',
                    weekendColor: '#a8d400',
                    size: 12
                },
                date: {
                    color: '#3b3b3b',
                    selectedColor: '#fff',
                    selectedBg: '#a8d500',
                    size: 12
                },
                today: {
                    color: 'rgb(230,46,37)',
                    bg: ''
                },
                specialDate: {
                    color: '#a8d500',
                    bg: 'widget://image/cp_footer3_N.png'
                }
            },
            specialDate:qiandaoriqi,
            switchMode: 'vertical',
            fixedOn: api.frameName,
            fixed: false
        }, function(ret, err) {
            if (ret) {
                // console.log("日历的回调函数---" + JSON.stringify(ret))

                if (ret.eventType == 'show') {
                    $('.today').text(ret.year + '.' + ret.month)
                    today_day = ret.day;
                }else if(ret.eventType == 'switch'){
                  $('.today').text(ret.year + '.' + ret.month)
                }
                else if (ret.eventType == "normal") {
                    if (ret.day != today_day) {
                        api.toast({
                            msg: '不能签到',
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                } else {
                  qiandao();
                }
            }
        });
    };



    function qiandao(){
      var now = new Date();
      // alert(now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate())
      api.ajax({
          url: window.Url.Freeucenter_sign,
          method: 'post',
          data: {
            values: {
                token: $api.getStorage('token')
            }
          }
      },function(ret, err){
          if (ret) {
              // console.log("签到----"+JSON.stringify( ret ) );
              api.toast({
                  msg: ret.info,
                  duration: 2000,
                  location: 'bottom'
              });
              if(ret.re==1){
                $('.have_day span').text(parseInt($('.have_day span').text())+1)
                $('.get_jf span').text(parseInt($('.get_jf span').text())+parseInt(ret.data.integral));
                qiandaoriqi.push({
                  date:now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate()
                })
                UICalendar.setSpecialDates({
                    specialDates: qiandaoriqi
                });
              }
          } else {
              alert( JSON.stringify( err ) );
          }
      });

    }


    // 查看规则
    function look_gz() {

        api.openFrame({
            name: 'punchcard_gz_frame',
            url: 'punchcard_gz_frame.html',
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 'auto'
            },
            pageParam: {
                name: 'test'
            },
            bounces: false,
            bgColor: 'rgba(0,0,0,0)'
        });
    }
</script>

</html>
